<!DOCTYPE html>
<html lang=zh>
<head>
  <meta charset="utf-8">
  
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-transform" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="format-detection" content="telephone=no,email=no,adress=no">
  <!-- Color theme for statusbar -->
  <meta name="theme-color" content="#000000" />
  <!-- 强制页面在当前窗口以独立页面显示,防止别人在框架里调用页面 -->
  <meta http-equiv="window-target" content="_top" />
  
  
  <title>软件版本号管理 | 惘客的个人博客</title>
  <meta name="description" content="版本号组成major主版本号，当软件接口或架构发生重大变化时调整，不同主版本号的软件不再相互兼容 minor次版本号，当软件新增了功能，且保持了向下兼容时调整 patch补丁版本号，当软件修复bug时调整 pre-release先行版本号都不算是正式发布版本，其主要用来表示软件的测试阶段，通常同一个阶段的多个版本会在后面添加递增的数字，如 rc.1。 αalphal，内部测试版，开发人员使用，可能">
<meta property="og:type" content="article">
<meta property="og:title" content="软件版本号管理">
<meta property="og:url" content="https://gycherish.gitee.io/blog/posts/179fbf26.html">
<meta property="og:site_name" content="惘客的个人博客">
<meta property="og:description" content="版本号组成major主版本号，当软件接口或架构发生重大变化时调整，不同主版本号的软件不再相互兼容 minor次版本号，当软件新增了功能，且保持了向下兼容时调整 patch补丁版本号，当软件修复bug时调整 pre-release先行版本号都不算是正式发布版本，其主要用来表示软件的测试阶段，通常同一个阶段的多个版本会在后面添加递增的数字，如 rc.1。 αalphal，内部测试版，开发人员使用，可能">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-06-02T16:00:00.000Z">
<meta property="article:modified_time" content="2021-11-21T14:55:55.876Z">
<meta property="article:author" content="惘客">
<meta property="article:tag" content="develop">
<meta name="twitter:card" content="summary">
  <!-- Canonical links -->
  <link rel="canonical" href="https://gycherish.gitee.io/blog/posts/179fbf26.html">
  
    <link rel="alternate" href="/atom.xml" title="惘客的个人博客" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png" type="image/x-icon">
  
  
<link rel="stylesheet" href="/blog/css/style.css">

  
  
  
  
<meta name="generator" content="Hexo 4.2.1"></head>


<body class="main-center theme-black" itemscope itemtype="http://schema.org/WebPage">
  <header class="header" itemscope itemtype="http://schema.org/WPHeader">
  <div class="slimContent">
    <div class="navbar-header">
      
      
      <div class="profile-block text-center">
        <a id="avatar" href="https://gitee.com/gycherish" target="_blank">
          <img class="img-circle img-rotate" src="/blog/images/head.jpg" width="200" height="200">
        </a>
        <h2 id="name" class="hidden-xs hidden-sm">惘客</h2>
        <h3 id="title" class="hidden-xs hidden-sm hidden-md">Linux C++ Server Developer</h3>
        <small id="location" class="text-muted hidden-xs hidden-sm"><i class="icon icon-map-marker"></i> Shanghai, China</small>
      </div>
      
      <div class="search" id="search-form-wrap">

    <form class="search-form sidebar-form">
        <div class="input-group">
            <input type="text" class="search-form-input form-control" placeholder="搜索" />
            <span class="input-group-btn">
                <button type="submit" class="search-form-submit btn btn-flat" onclick="return false;"><i class="icon icon-search"></i></button>
            </span>
        </div>
    </form>
    <div class="ins-search">
  <div class="ins-search-mask"></div>
  <div class="ins-search-container">
    <div class="ins-input-wrapper">
      <input type="text" class="ins-search-input" placeholder="想要查找什么..." x-webkit-speech />
      <button type="button" class="close ins-close ins-selectable" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
    </div>
    <div class="ins-section-wrapper">
      <div class="ins-section-container"></div>
    </div>
  </div>
</div>


</div>
      <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#main-navbar" aria-controls="main-navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>
    <nav id="main-navbar" class="collapse navbar-collapse" itemscope itemtype="http://schema.org/SiteNavigationElement" role="navigation">
      <ul class="nav navbar-nav main-nav ">
        
        
        <li class="menu-item menu-item-home">
          <a href="/blog/.">
            
            <i class="icon icon-home-fill"></i>
            
            <span class="menu-title">首页</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-archives">
          <a href="/blog/archives">
            
            <i class="icon icon-archives-fill"></i>
            
            <span class="menu-title">归档</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-categories">
          <a href="/blog/categories">
            
            <i class="icon icon-folder"></i>
            
            <span class="menu-title">分类</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-tags">
          <a href="/blog/tags">
            
            <i class="icon icon-tags"></i>
            
            <span class="menu-title">标签</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-repository">
          <a href="/blog/repository">
            
            <i class="icon icon-project"></i>
            
            <span class="menu-title">项目</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-about">
          <a href="/blog/about">
            
            <i class="icon icon-cup-fill"></i>
            
            <span class="menu-title">关于</span>
          </a>
        </li>
        
      </ul>
      
	
    <ul class="social-links">
    	
        <li><a href="https://gitee.com/gycherish" target="_blank" title="Gitee" data-toggle=tooltip data-placement=top><i class="icon icon-gitee"></i></a></li>
        
        <li><a href="/blog/atom.xml" target="_blank" title="Rss" data-toggle=tooltip data-placement=top><i class="icon icon-rss"></i></a></li>
        
    </ul>

    </nav>
  </div>
</header>

  
    <aside class="sidebar" itemscope itemtype="http://schema.org/WPSideBar">
  <div class="slimContent">
    
      <div class="widget">
    <h3 class="widget-title">公告</h3>
    <div class="widget-body">
        <div id="board">
            <div class="content">
                <p>欢迎交流与分享经验!</p>
            </div>
        </div>
    </div>
</div>

    
      

    
      
  <div class="widget">
    <h3 class="widget-title">标签</h3>
    <div class="widget-body">
      <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/bios/" rel="tag">bios</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/c/" rel="tag">c++</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/cmake/" rel="tag">cmake</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/cpu/" rel="tag">cpu</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/develop/" rel="tag">develop</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/docker/" rel="tag">docker</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/dpdk/" rel="tag">dpdk</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/fs/" rel="tag">fs</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/git/" rel="tag">git</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/hexo/" rel="tag">hexo</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/linux/" rel="tag">linux</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/lvm/" rel="tag">lvm</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/mbr/" rel="tag">mbr</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/os/" rel="tag">os</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/phabricator/" rel="tag">phabricator</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/tmux/" rel="tag">tmux</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/blog/tags/yum/" rel="tag">yum</a><span class="tag-list-count">1</span></li></ul>
    </div>
  </div>


    
      
  <div class="widget">
    <h3 class="widget-title">标签云</h3>
    <div class="widget-body tagcloud">
      <a href="/blog/tags/bios/" style="font-size: 13px;">bios</a> <a href="/blog/tags/c/" style="font-size: 13px;">c++</a> <a href="/blog/tags/cmake/" style="font-size: 13px;">cmake</a> <a href="/blog/tags/cpu/" style="font-size: 13px;">cpu</a> <a href="/blog/tags/develop/" style="font-size: 14px;">develop</a> <a href="/blog/tags/docker/" style="font-size: 13px;">docker</a> <a href="/blog/tags/dpdk/" style="font-size: 13px;">dpdk</a> <a href="/blog/tags/fs/" style="font-size: 13.25px;">fs</a> <a href="/blog/tags/git/" style="font-size: 13.75px;">git</a> <a href="/blog/tags/hexo/" style="font-size: 13.5px;">hexo</a> <a href="/blog/tags/linux/" style="font-size: 13.5px;">linux</a> <a href="/blog/tags/lvm/" style="font-size: 13px;">lvm</a> <a href="/blog/tags/mbr/" style="font-size: 13px;">mbr</a> <a href="/blog/tags/os/" style="font-size: 13.25px;">os</a> <a href="/blog/tags/phabricator/" style="font-size: 13px;">phabricator</a> <a href="/blog/tags/tmux/" style="font-size: 13px;">tmux</a> <a href="/blog/tags/yum/" style="font-size: 13px;">yum</a>
    </div>
  </div>

    
      
  <div class="widget">
    <h3 class="widget-title">归档</h3>
    <div class="widget-body">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2022/05/">五月 2022</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2022/04/">四月 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2022/01/">一月 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2021/08/">八月 2021</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2021/05/">五月 2021</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2021/03/">三月 2021</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2020/06/">六月 2020</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2020/05/">五月 2020</a><span class="archive-list-count">9</span></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2019/11/">十一月 2019</a><span class="archive-list-count">1</span></li></ul>
    </div>
  </div>


    
      
  <div class="widget">
    <h3 class="widget-title">最新文章</h3>
    <div class="widget-body">
      <ul class="recent-post-list list-unstyled no-thumbnail">
        
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                
              </p>
              <p class="item-title">
                <a href="/blog/posts/dc0447d5.html" class="title">bios</a>
              </p>
              <p class="item-date">
                <time datetime="2022-05-17T09:35:00.000Z" itemprop="datePublished">2022-05-17</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                
              </p>
              <p class="item-title">
                <a href="/blog/posts/57db9b5a.html" class="title">Intel处理器架构简介</a>
              </p>
              <p class="item-date">
                <time datetime="2022-05-16T07:05:00.000Z" itemprop="datePublished">2022-05-16</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                
              </p>
              <p class="item-title">
                <a href="/blog/posts/7d606a33.html" class="title">高性能编程指南</a>
              </p>
              <p class="item-date">
                <time datetime="2022-04-07T09:30:00.000Z" itemprop="datePublished">2022-04-07</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                
              </p>
              <p class="item-title">
                <a href="/blog/posts/7deb74e6.html" class="title">编译编译器</a>
              </p>
              <p class="item-date">
                <time datetime="2022-01-17T13:55:50.000Z" itemprop="datePublished">2022-01-17</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                
              </p>
              <p class="item-title">
                <a href="/blog/posts/aa24c566.html" class="title">编写changelog</a>
              </p>
              <p class="item-date">
                <time datetime="2021-08-13T07:59:30.000Z" itemprop="datePublished">2021-08-13</time>
              </p>
            </div>
          </li>
          
      </ul>
    </div>
  </div>
  

    
  </div>
</aside>

  
  
<main class="main" role="main">
  <div class="content">
  <article id="post-Develop/软件版本号管理" class="article article-type-post" itemscope itemtype="http://schema.org/BlogPosting">
    
    <div class="article-header">
      
        
  
    <h1 class="article-title" itemprop="name">
      软件版本号管理
    </h1>
  

      
      <div class="article-meta">
        <span class="article-date">
    <i class="icon icon-calendar-check"></i>
	<a href="/blog/posts/179fbf26.html" class="article-date">
	  <time datetime="2020-06-02T16:00:00.000Z" itemprop="datePublished">2020-06-03</time>
	</a>
</span>
        
        
  <span class="article-tag">
    <i class="icon icon-tags"></i>
	<a class="article-tag-link" href="/blog/tags/develop/" rel="tag">develop</a>
  </span>


        
	<span class="article-read hidden-xs">
	    <i class="icon icon-eye-fill" aria-hidden="true"></i>
	    <span id="busuanzi_container_page_pv">
			<span id="busuanzi_value_page_pv">0</span>
		</span>
	</span>


        <span class="post-comment"><i class="icon icon-comment"></i> <a href="/blog/posts/179fbf26.html#comments" class="article-comment-link">评论</a></span>
        
      </div>
    </div>
    <div class="article-entry marked-body" itemprop="articleBody">
      
        <h2 id="版本号组成"><a href="#版本号组成" class="headerlink" title="版本号组成"></a>版本号组成</h2><h3 id="major"><a href="#major" class="headerlink" title="major"></a>major</h3><p>主版本号，当软件接口或架构发生重大变化时调整，不同主版本号的软件不再相互兼容</p>
<h3 id="minor"><a href="#minor" class="headerlink" title="minor"></a>minor</h3><p>次版本号，当软件新增了功能，且保持了向下兼容时调整</p>
<h3 id="patch"><a href="#patch" class="headerlink" title="patch"></a>patch</h3><p>补丁版本号，当软件修复bug时调整</p>
<h3 id="pre-release"><a href="#pre-release" class="headerlink" title="pre-release"></a>pre-release</h3><p>先行版本号都不算是正式发布版本，其主要用来表示软件的测试阶段，通常同一个阶段的多个版本会在后面添加递增的数字，如 rc.1。</p>
<h4 id="α"><a href="#α" class="headerlink" title="α"></a>α</h4><p>alphal，内部测试版，开发人员使用，可能含有重大bug，不推荐给用户使用</p>
<h4 id="β"><a href="#β" class="headerlink" title="β"></a>β</h4><p>beta，外部测试版，相比α版，消除了严重的错误，但可能还存在一些轻微的缺陷</p>
<h4 id="rc"><a href="#rc" class="headerlink" title="rc"></a>rc</h4><p>release candidate，发布候选版，该版本已经非常稳定了，与最终发布版本相差无几</p>
<h3 id="build"><a href="#build" class="headerlink" title="build"></a>build</h3><p>构建版本号，主要用于表示构建信息，一般用 git 的 commit hash 或者 svn 的 revision 表示。为了能够精确识别每次编译的程序对应具体哪次提交可以加上该版本号。</p>
<h2 id="版本号命名"><a href="#版本号命名" class="headerlink" title="版本号命名"></a>版本号命名</h2><p>按照语义化版本号的规范，命名格式如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br></pre></td><td class="code"><pre><span class="line">&lt;valid semver&gt; ::&#x3D; &lt;version core&gt;</span><br><span class="line">                 | &lt;version core&gt; &quot;-&quot; &lt;pre-release&gt;</span><br><span class="line">                 | &lt;version core&gt; &quot;+&quot; &lt;build&gt;</span><br><span class="line">                 | &lt;version core&gt; &quot;-&quot; &lt;pre-release&gt; &quot;+&quot; &lt;build&gt;</span><br><span class="line"></span><br><span class="line">&lt;version core&gt; ::&#x3D; &lt;major&gt; &quot;.&quot; &lt;minor&gt; &quot;.&quot; &lt;patch&gt;</span><br><span class="line"></span><br><span class="line">&lt;major&gt; ::&#x3D; &lt;numeric identifier&gt;</span><br><span class="line"></span><br><span class="line">&lt;minor&gt; ::&#x3D; &lt;numeric identifier&gt;</span><br><span class="line"></span><br><span class="line">&lt;patch&gt; ::&#x3D; &lt;numeric identifier&gt;</span><br><span class="line"></span><br><span class="line">&lt;pre-release&gt; ::&#x3D; &lt;dot-separated pre-release identifiers&gt;</span><br><span class="line"></span><br><span class="line">&lt;dot-separated pre-release identifiers&gt; ::&#x3D; &lt;pre-release identifier&gt;</span><br><span class="line">                                          | &lt;pre-release identifier&gt; &quot;.&quot; &lt;dot-separated pre-release identifiers&gt;</span><br><span class="line"></span><br><span class="line">&lt;build&gt; ::&#x3D; &lt;dot-separated build identifiers&gt;</span><br><span class="line"></span><br><span class="line">&lt;dot-separated build identifiers&gt; ::&#x3D; &lt;build identifier&gt;</span><br><span class="line">                                    | &lt;build identifier&gt; &quot;.&quot; &lt;dot-separated build identifiers&gt;</span><br><span class="line"></span><br><span class="line">&lt;pre-release identifier&gt; ::&#x3D; &lt;alphanumeric identifier&gt;</span><br><span class="line">                           | &lt;numeric identifier&gt;</span><br><span class="line"></span><br><span class="line">&lt;build identifier&gt; ::&#x3D; &lt;alphanumeric identifier&gt;</span><br><span class="line">                     | &lt;digits&gt;</span><br><span class="line"></span><br><span class="line">&lt;alphanumeric identifier&gt; ::&#x3D; &lt;non-digit&gt;</span><br><span class="line">                            | &lt;non-digit&gt; &lt;identifier characters&gt;</span><br><span class="line">                            | &lt;identifier characters&gt; &lt;non-digit&gt;</span><br><span class="line">                            | &lt;identifier characters&gt; &lt;non-digit&gt; &lt;identifier characters&gt;</span><br><span class="line"></span><br><span class="line">&lt;numeric identifier&gt; ::&#x3D; &quot;0&quot;</span><br><span class="line">                       | &lt;positive digit&gt;</span><br><span class="line">                       | &lt;positive digit&gt; &lt;digits&gt;</span><br><span class="line"></span><br><span class="line">&lt;identifier characters&gt; ::&#x3D; &lt;identifier character&gt;</span><br><span class="line">                          | &lt;identifier character&gt; &lt;identifier characters&gt;</span><br><span class="line"></span><br><span class="line">&lt;identifier character&gt; ::&#x3D; &lt;digit&gt;</span><br><span class="line">                         | &lt;non-digit&gt;</span><br><span class="line"></span><br><span class="line">&lt;non-digit&gt; ::&#x3D; &lt;letter&gt;</span><br><span class="line">              | &quot;-&quot;</span><br><span class="line"></span><br><span class="line">&lt;digits&gt; ::&#x3D; &lt;digit&gt;</span><br><span class="line">           | &lt;digit&gt; &lt;digits&gt;</span><br><span class="line"></span><br><span class="line">&lt;digit&gt; ::&#x3D; &quot;0&quot;</span><br><span class="line">          | &lt;positive digit&gt;</span><br><span class="line"></span><br><span class="line">&lt;positive digit&gt; ::&#x3D; &quot;1&quot; | &quot;2&quot; | &quot;3&quot; | &quot;4&quot; | &quot;5&quot; | &quot;6&quot; | &quot;7&quot; | &quot;8&quot; | &quot;9&quot;</span><br><span class="line"></span><br><span class="line">&lt;letter&gt; ::&#x3D; &quot;A&quot; | &quot;B&quot; | &quot;C&quot; | &quot;D&quot; | &quot;E&quot; | &quot;F&quot; | &quot;G&quot; | &quot;H&quot; | &quot;I&quot; | &quot;J&quot;</span><br><span class="line">           | &quot;K&quot; | &quot;L&quot; | &quot;M&quot; | &quot;N&quot; | &quot;O&quot; | &quot;P&quot; | &quot;Q&quot; | &quot;R&quot; | &quot;S&quot; | &quot;T&quot;</span><br><span class="line">           | &quot;U&quot; | &quot;V&quot; | &quot;W&quot; | &quot;X&quot; | &quot;Y&quot; | &quot;Z&quot; | &quot;a&quot; | &quot;b&quot; | &quot;c&quot; | &quot;d&quot;</span><br><span class="line">           | &quot;e&quot; | &quot;f&quot; | &quot;g&quot; | &quot;h&quot; | &quot;i&quot; | &quot;j&quot; | &quot;k&quot; | &quot;l&quot; | &quot;m&quot; | &quot;n&quot;</span><br><span class="line">           | &quot;o&quot; | &quot;p&quot; | &quot;q&quot; | &quot;r&quot; | &quot;s&quot; | &quot;t&quot; | &quot;u&quot; | &quot;v&quot; | &quot;w&quot; | &quot;x&quot;</span><br><span class="line">           | &quot;y&quot; | &quot;z&quot;</span><br></pre></td></tr></table></figure>

<p>举例如下：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">0.1.0 <span class="comment"># &lt;version core&gt;</span></span><br><span class="line">0.2.1-alpha <span class="comment"># &lt;version core&gt;"-"&lt;pre-release&gt;</span></span><br><span class="line">0.2.1-beta.1 <span class="comment"># &lt;version core&gt;"-"&lt;pre-release&gt;</span></span><br><span class="line">1.3.2-rc.2+5abe79f <span class="comment"># &lt;version core&gt;"-"&lt;pre-release&gt;"+"&lt;build&gt;</span></span><br><span class="line">4.5.6+5abe79f <span class="comment"># &lt;version core&gt;"+"&lt;build&gt;</span></span><br><span class="line">5.4.5+4567 <span class="comment"># &lt;version core&gt;"+"&lt;build&gt;</span></span><br></pre></td></tr></table></figure>
<p>这里的<build>是 git commit hash 或 svn revision</p>
<h2 id="初始化版本号"><a href="#初始化版本号" class="headerlink" title="初始化版本号"></a>初始化版本号</h2><p>每次开发一款新软件时建议初始发布版本号从<strong>0.1.0</strong>开始，然后进行快速迭代，该过程中不考虑向下兼容问题，直到软件整体接口或功能成熟后正式发布<strong>1.0.0</strong>版本，对于需求不明确的软件，主版本号为0的版本可能会存在较长时间。</p>
<h2 id="软件包命名"><a href="#软件包命名" class="headerlink" title="软件包命名"></a>软件包命名</h2><p>以下格式为个人喜好：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;project-name&gt;-&lt;valid semver&gt;-&lt;date&gt;.&lt;extension&gt;</span><br></pre></td></tr></table></figure>
<p>其中<data>是可以作为<valid semver>的<build>版本的一部分，当<valid semver>不包含<data>时可以在打包时添加上打包日期。</p>
<p>举例如下：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">xxx-1.2.3-20200603.tar.gz</span><br><span class="line">xxx-1.2.3-5abe79f-20200603.tar.gz</span><br><span class="line">xxx-1.2.3-rc.2-5abe79f-20200603.tar.gz</span><br></pre></td></tr></table></figure>
<p>注意，因为符号 “+” 在有些文件系统上不合法，这里全部使用 “-“ 连接<valid semver>中的各个部分。</p>
<h2 id="参考文档"><a href="#参考文档" class="headerlink" title="参考文档"></a>参考文档</h2><ul>
<li><a href="https://semver.org/lang/zh-CN/" target="_blank" rel="noopener">语义化版本</a></li>
</ul>

      
    </div>
    <div class="article-footer">
      <blockquote class="mt-2x">
  <ul class="post-copyright list-unstyled">
    
    <li class="post-copyright-link hidden-xs">
      <strong>本文链接：</strong>
      <a href="https://gycherish.gitee.io/blog/posts/179fbf26.html" title="软件版本号管理" target="_blank" rel="external">https://gycherish.gitee.io/blog/posts/179fbf26.html</a>
    </li>
    
    <li class="post-copyright-license">
      <strong>版权声明： </strong> 本博客所有文章除特别声明外，均采用 <a href="http://creativecommons.org/licenses/by/4.0/deed.zh" target="_blank" rel="external">CC BY 4.0 CN协议</a> 许可协议。转载请注明出处！
    </li>
  </ul>
</blockquote>


<div class="panel panel-default panel-badger">
  <div class="panel-body">
    <figure class="media">
      <div class="media-left">
        <a href="https://gitee.com/gycherish" target="_blank" class="img-burn thumb-sm visible-lg">
          <img src="/blog/images/head.jpg" class="img-rounded w-full" alt="">
        </a>
      </div>
      <div class="media-body">
        <h3 class="media-heading"><a href="https://gitee.com/gycherish" target="_blank"><span class="text-dark">惘客</span><small class="ml-1x">Linux C++ Server Developer</small></a></h3>
        <div>宁静致远，淡泊明志！</div>
      </div>
    </figure>
  </div>
</div>


    </div>
  </article>
  
    
  <section id="comments">
  	
  </section>


  
</div>

  <nav class="bar bar-footer clearfix" data-stick-bottom>
  <div class="bar-inner">
  
  <ul class="pager pull-left">
    
    <li class="prev">
      <a href="/blog/posts/1d0092f5.html" title="软件开发问题汇总"><i class="icon icon-angle-left" aria-hidden="true"></i><span>&nbsp;&nbsp;上一篇</span></a>
    </li>
    
    
    <li class="next">
      <a href="/blog/posts/b80e856e.html" title="CMake常用功能"><span>下一篇&nbsp;&nbsp;</span><i class="icon icon-angle-right" aria-hidden="true"></i></a>
    </li>
    
    
  </ul>
  
  
  <!-- Button trigger modal -->
  <button type="button" class="btn btn-fancy btn-donate pop-onhover bg-gradient-warning" data-toggle="modal" data-target="#donateModal"><span>赏</span></button>
  <!-- <div class="wave-icon wave-icon-danger btn-donate" data-toggle="modal" data-target="#donateModal">
    <div class="wave-circle"><span class="icon"><i class="icon icon-bill"></i></span></div>
  </div> -->
  
  
  <div class="bar-right">
    
    <div class="share-component" data-sites="weibo,qq,wechat,facebook,twitter" data-mobile-sites="weibo,qq,qzone"></div>
    
  </div>
  </div>
</nav>
  
<!-- Modal -->
<div class="modal modal-center modal-small modal-xs-full fade" id="donateModal" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content donate">
      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
      <div class="modal-body">
        <div class="donate-box">
          <div class="donate-head">
            <p>感谢您的支持，我会继续努力的!</p>
          </div>
          <div class="tab-content">
            <div role="tabpanel" class="tab-pane fade active in" id="alipay">
              <div class="donate-payimg">
                <img src="/blog/images/donate/alipay.jpg" alt="扫码支持" title="扫一扫" />
              </div>
              <p class="text-muted mv">扫码打赏，你说多少就多少</p>
              <p class="text-grey">打开支付宝扫一扫，即可进行扫码打赏哦</p>
            </div>
            <div role="tabpanel" class="tab-pane fade" id="wechatpay">
              <div class="donate-payimg">
                <img src="/blog/images/donate/wechatpay.jpg" alt="扫码支持" title="扫一扫" />
              </div>
              <p class="text-muted mv">扫码打赏，你说多少就多少</p>
              <p class="text-grey">打开微信扫一扫，即可进行扫码打赏哦</p>
            </div>
          </div>
          <div class="donate-footer">
            <ul class="nav nav-tabs nav-justified" role="tablist">
              <li role="presentation" class="active">
                <a href="#alipay" id="alipay-tab" role="tab" data-toggle="tab" aria-controls="alipay" aria-expanded="true"><i class="icon icon-alipay"></i> 支付宝</a>
              </li>
              <li role="presentation" class="">
                <a href="#wechatpay" role="tab" id="wechatpay-tab" data-toggle="tab" aria-controls="wechatpay" aria-expanded="false"><i class="icon icon-wepay"></i> 微信支付</a>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>



</main>

  <footer class="footer" itemscope itemtype="http://schema.org/WPFooter">
	
	
    <ul class="social-links">
    	
        <li><a href="https://gitee.com/gycherish" target="_blank" title="Gitee" data-toggle=tooltip data-placement=top><i class="icon icon-gitee"></i></a></li>
        
        <li><a href="/blog/atom.xml" target="_blank" title="Rss" data-toggle=tooltip data-placement=top><i class="icon icon-rss"></i></a></li>
        
    </ul>

    <div class="copyright">
    	
        &copy; 2024 惘客
        
        <!-- <div class="publishby">
        	Theme by <a href="https://github.com/cofess" target="_blank"> cofess </a>base on <a href="https://github.com/cofess/hexo-theme-pure" target="_blank">pure</a>.
        </div> -->
        <div class="police">
            <img src="/blog/images/beian.png" style="float:left;" /><a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=41152702000156" target="_blank">豫公网安备41152702000156号</a>
        </div>
        <div class="beianinfo">
            <a href="https://beian.miit.gov.cn/" target="_blank">豫ICP备2021012829号</a>
        </div>
    </div>
</footer>
  <script src="//cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')
</script>

<script src="/blog/js/plugin.min.js"></script>


<script src="/blog/js/application.js"></script>


    <script>
(function (window) {
    var INSIGHT_CONFIG = {
        TRANSLATION: {
            POSTS: '文章',
            PAGES: '页面',
            CATEGORIES: '分类',
            TAGS: '标签',
            UNTITLED: '(未命名)',
        },
        ROOT_URL: '/blog/',
        CONTENT_URL: '/blog/content.json',
    };
    window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
</script>

<script src="/blog/js/insight.js"></script>






   
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>





   







<!-- 添加回到顶部按钮 -->
<div id="go-top"></div>
<style type="text/css">
#go-top {
 width:40px;height:40px;
 background-color:#8cc2ff;
 position:relative;
 border-radius:20px;
 position:fixed;right:10px;bottom:60px;
 cursor:pointer;display:none;
}
#go-top:after {
 content:" ";
 position:absolute;left:14px;top:14px;
 border-top:2px solid #fff;border-right:2px solid #fff;
 width:12px;height:12px;
 transform:rotate(-45deg);
}
#go-top:hover {
 background-color:#8A2BE2;
}
</style>
<script>
$(function () {
  var top=$("#go-top");
  $(window).scroll(function () {
    ($(window).scrollTop() > 300) ? top.show(300) : top.hide(200);
    $("#go-top").click(function () {
      $('body,html').animate({scrollTop:0});
      return false();
    })
  });
});
</script>
</body>
</html>